<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let person = { name: '张三',age:20};
        // let {name,age} = person;
        // console.log(name);
        // console.log(age);
        // let person = {name : "站提供三",age : 20};
        // let {name:myname,age:myage} = person;
        // console.log(myname);
        // console.log(myage);
        // let person = {name : "站提供三",age : 20,hobby: ['篮球','足球','排球']};
        // let {name:name,age:age,hobby:hobby} = person;
        // console.log(name);
        // console.log(age);
        // console.log(hobby); //['篮球','足球','地球']
        //es6 当中 对象 如果key 跟val 相同 可以只写一个
        // 左右两边 结构一致  右边要是一个不出错的代码
        let person = {name : "站提供三",age : 20,hobby: ['篮球','足球','排球']};
        let {name,age,hobby} = person;
         console.log(name); // 'zhangsan' 
        console.log(age); // 20
        console.log(hobby); // ['篮球','足球','地球']
    </script>
</body>
</html>